//
//  pTableViewCell.m
//  jiaxingchengtou
//
//  Created by michael on 2018/5/30.
//  Copyright © 2018年 czd. All rights reserved.
//

#import "pTableViewCell.h"
#import "UIImageView+WebCache.h"

@implementation pTableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
 self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
 if (self) {
   _image = [[UIImageView alloc]initWithFrame:CGRectZero];
    [self.contentView addSubview:_image];
    _label = [[UILabel alloc]initWithFrame:CGRectZero];
        [self.contentView addSubview:_label];
 }

    return self;

}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
  

}
- (void)layoutSubviews{
[super layoutSubviews];
   float i  = [_model.pic floatValue];
           _image.frame = CGRectMake(0, 0, KScreenWidth,KScreenWidth* i);
  [_image sd_setImageWithURL:[NSURL URLWithString:_model.attachmentsURL]];
   _label.frame = CGRectMake(0, _image.bottom, KScreenWidth, 30);
              _label.text = _model.attachmentsTitle;

_label.textAlignment = 1;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
